import 'package:flutter_nb_net/flutter_net.dart';

class DeviceListResp extends BaseNetModel {
  int? code;
  String? msg;
  List<DeviceListData>? data;

  DeviceListResp({this.code, this.msg, this.data});

  @override
  fromJson(Map<String, dynamic> json) {
    return DeviceListResp(
      code: json['code'],
      msg: json['msg'],
      data: json['data'] != null ? List<DeviceListData>.from(json['data'].map((x) => DeviceListData().fromJson(x))) : null,
    );
  }
}

class DeviceListData extends BaseNetModel {
  String? imei;
  String? deviceName;
  String? iccid;
  num? batteryPercentage;
  int? deviceStatus;

  DeviceListData({this.imei, this.deviceName, this.iccid, this.batteryPercentage, this.deviceStatus});

  @override
  fromJson(Map<String, dynamic> json) {
    return DeviceListData(
      imei: json['imei'],
      deviceName: json['deviceName'],
      iccid: json['iccid'],
      batteryPercentage: json['batteryPercentage'],
      deviceStatus: json['deviceStatus'],
    );
  }
}